remainder theorem quant number system